<?php

namespace common\models\share;

use Yii;

/**
 * This is the model class for table "{{%share_log}}".
 *
 * @property int $id
 * @property string $model
 * @property string $model_id
 * @property string $content
 * @property int $status
 * @property string $created_at
 * @property string $update_at
 */
class ShareLog extends \yii\db\ActiveRecord {

    use \common\traits\Constants;
    use \common\traits\TimestampBehavior;
    use \common\traits\QueryInstanceActiveRecord;

    const STATUS_ACTIVE = 1;
    const STATUS_DEFAULT = 0;

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return '{{%share_log}}';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [
            [['model', 'content'], 'required'],
            [['model_id', 'user_id', 'device_id', 'created_at', 'updated_at'], 'integer'],
            [['content'], 'string'],
            [['model'], 'string', 'max' => 50],
            [['status'], 'string', 'max' => 1],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'id' => 'ID',
            'model' => 'Model',
            'model_id' => 'Model ID',
            'user_id' => '用户ID',
            'device_id' => '设备ID',
            'content' => 'Content',
            'status' => 'Status',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }

}
